bulk of the tests were commented out, oops.
authorHavoc Pennington <hp@redhat.com>
Wed, 14 Nov 2001 18:58:26 +0000 (18:58 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Wed, 14 Nov 2001 18:58:26 +0000 (18:58 +0000)
2001-11-14  Havoc Pennington  <hp@redhat.com>

* tests/testtextbuffer.c (main): bulk of the tests were commented
out, oops.

* gtk/gtktextiter.c (find_paragraph_delimiter_for_line): make this
function work, should resolve #63426
(gtk_text_iter_ends_line): return TRUE for the end iterator

* gtk/gtktextiter.h: put padding back in GtkTextIter, I thought of
a couple things that might get cached in here.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktextiter.c
gtk/gtktextiter.h
tests/testtextbuffer.c

index 16aad39b4d3aeb41a2a27bef0cebca7832be6f9f..25fc94d546e51998ab61ec1ef82dada9a4bb9eab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2001-11-14  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testtextbuffer.c (main): bulk of the tests were commented
+       out, oops.
+
+       * gtk/gtktextiter.c (find_paragraph_delimiter_for_line): make this 
+       function work, should resolve #63426
+       (gtk_text_iter_ends_line): return TRUE for the end iterator
+
+       * gtk/gtktextiter.h: put padding back in GtkTextIter, I thought of
+       a couple things that might get cached in here.
+
 Tue Nov 13 21:00:59 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreemodelsort.c (gtk_tree_model_sort_class_init): new
index 16aad39b4d3aeb41a2a27bef0cebca7832be6f9f..25fc94d546e51998ab61ec1ef82dada9a4bb9eab 100644 (file)
@@ -1,3 +1,15 @@
+2001-11-14  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testtextbuffer.c (main): bulk of the tests were commented
+       out, oops.
+
+       * gtk/gtktextiter.c (find_paragraph_delimiter_for_line): make this 
+       function work, should resolve #63426
+       (gtk_text_iter_ends_line): return TRUE for the end iterator
+
+       * gtk/gtktextiter.h: put padding back in GtkTextIter, I thought of
+       a couple things that might get cached in here.
+
 Tue Nov 13 21:00:59 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreemodelsort.c (gtk_tree_model_sort_class_init): new
index 16aad39b4d3aeb41a2a27bef0cebca7832be6f9f..25fc94d546e51998ab61ec1ef82dada9a4bb9eab 100644 (file)
@@ -1,3 +1,15 @@
+2001-11-14  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testtextbuffer.c (main): bulk of the tests were commented
+       out, oops.
+
+       * gtk/gtktextiter.c (find_paragraph_delimiter_for_line): make this 
+       function work, should resolve #63426
+       (gtk_text_iter_ends_line): return TRUE for the end iterator
+
+       * gtk/gtktextiter.h: put padding back in GtkTextIter, I thought of
+       a couple things that might get cached in here.
+
 Tue Nov 13 21:00:59 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreemodelsort.c (gtk_tree_model_sort_class_init): new
index 16aad39b4d3aeb41a2a27bef0cebca7832be6f9f..25fc94d546e51998ab61ec1ef82dada9a4bb9eab 100644 (file)
@@ -1,3 +1,15 @@
+2001-11-14  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testtextbuffer.c (main): bulk of the tests were commented
+       out, oops.
+
+       * gtk/gtktextiter.c (find_paragraph_delimiter_for_line): make this 
+       function work, should resolve #63426
+       (gtk_text_iter_ends_line): return TRUE for the end iterator
+
+       * gtk/gtktextiter.h: put padding back in GtkTextIter, I thought of
+       a couple things that might get cached in here.
+
 Tue Nov 13 21:00:59 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreemodelsort.c (gtk_tree_model_sort_class_init): new
index 16aad39b4d3aeb41a2a27bef0cebca7832be6f9f..25fc94d546e51998ab61ec1ef82dada9a4bb9eab 100644 (file)
@@ -1,3 +1,15 @@
+2001-11-14  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testtextbuffer.c (main): bulk of the tests were commented
+       out, oops.
+
+       * gtk/gtktextiter.c (find_paragraph_delimiter_for_line): make this 
+       function work, should resolve #63426
+       (gtk_text_iter_ends_line): return TRUE for the end iterator
+
+       * gtk/gtktextiter.h: put padding back in GtkTextIter, I thought of
+       a couple things that might get cached in here.
+
 Tue Nov 13 21:00:59 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreemodelsort.c (gtk_tree_model_sort_class_init): new
index 16aad39b4d3aeb41a2a27bef0cebca7832be6f9f..25fc94d546e51998ab61ec1ef82dada9a4bb9eab 100644 (file)
@@ -1,3 +1,15 @@
+2001-11-14  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testtextbuffer.c (main): bulk of the tests were commented
+       out, oops.
+
+       * gtk/gtktextiter.c (find_paragraph_delimiter_for_line): make this 
+       function work, should resolve #63426
+       (gtk_text_iter_ends_line): return TRUE for the end iterator
+
+       * gtk/gtktextiter.h: put padding back in GtkTextIter, I thought of
+       a couple things that might get cached in here.
+
 Tue Nov 13 21:00:59 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreemodelsort.c (gtk_tree_model_sort_class_init): new
index 16aad39b4d3aeb41a2a27bef0cebca7832be6f9f..25fc94d546e51998ab61ec1ef82dada9a4bb9eab 100644 (file)
@@ -1,3 +1,15 @@
+2001-11-14  Havoc Pennington  <hp@redhat.com>
+
+       * tests/testtextbuffer.c (main): bulk of the tests were commented
+       out, oops.
+
+       * gtk/gtktextiter.c (find_paragraph_delimiter_for_line): make this 
+       function work, should resolve #63426
+       (gtk_text_iter_ends_line): return TRUE for the end iterator
+
+       * gtk/gtktextiter.h: put padding back in GtkTextIter, I thought of
+       a couple things that might get cached in here.
+
 Tue Nov 13 21:00:59 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreemodelsort.c (gtk_tree_model_sort_class_init): new
index cd380f68a01f06ddaeecbb7fb15f5dd3cd031561..041ec23099a724e615bb9b48086c4c352586fcfe 100644 (file)
@@ -65,6 +65,10 @@ struct _GtkTextRealIter
      and ditto for char offsets. */
   gint segment_byte_offset;
   gint segment_char_offset;
+
+  /* padding */
+  gint pad1;
+  gpointer pad2;
 };
 
 /* These "set" functions should not assume any fields
@@ -1511,12 +1515,14 @@ gtk_text_iter_starts_line (const GtkTextIter   *iter)
  * gtk_text_iter_ends_line:
  * @iter: an iterator
  *
- * Returns %TRUE if @iter points to the start of the paragraph delimiter
- * characters for a line (delimiters will be either a newline, a
- * carriage return, a carriage return followed by a newline, or a
- * Unicode paragraph separator character). Note that an iterator pointing
- * to the \n of a \r\n pair will not be counted as the end of a line,
- * the line ends before the \r.
+ * Returns %TRUE if @iter points to the start of the paragraph
+ * delimiter characters for a line (delimiters will be either a
+ * newline, a carriage return, a carriage return followed by a
+ * newline, or a Unicode paragraph separator character). Note that an
+ * iterator pointing to the \n of a \r\n pair will not be counted as
+ * the end of a line, the line ends before the \r. The end iterator is
+ * considered to be at the end of a line, even though there are no
+ * paragraph delimiter chars there.
  *
  * Return value: whether @iter is at the end of a line
  **/
@@ -1539,7 +1545,7 @@ gtk_text_iter_ends_line (const GtkTextIter   *iter)
 
   wc = gtk_text_iter_get_char (iter);
   
-  if (wc == '\r' || wc == PARAGRAPH_SEPARATOR)
+  if (wc == '\r' || wc == PARAGRAPH_SEPARATOR || wc == 0) /* wc == 0 is end iterator */
     return TRUE;
   else if (wc == '\n')
     {
@@ -3760,11 +3766,17 @@ find_paragraph_delimiter_for_line (GtkTextIter *iter)
   GtkTextIter end;
   end = *iter;
 
-  /* if we aren't on the last line, go forward to start of next line, then scan
-   * back for the delimiters on the previous line
-   */
-  if (gtk_text_iter_forward_line (&end))
+  if (_gtk_text_line_contains_end_iter (_gtk_text_iter_get_text_line (&end),
+                                        _gtk_text_iter_get_btree (&end)))
+    {
+      gtk_text_iter_forward_to_end (&end);
+    }
+  else
     {
+      /* if we aren't on the last line, go forward to start of next line, then scan
+       * back for the delimiters on the previous line
+       */
+      gtk_text_iter_forward_line (&end);
       gtk_text_iter_backward_char (&end);
       while (!gtk_text_iter_ends_line (&end))
         gtk_text_iter_backward_char (&end);
index 887593f01f5d9f766620d02b863f6eaafb95ddd5..7c03968719d8a7cfc0fde0fe444c687f6e384c35 100644 (file)
@@ -66,6 +66,9 @@ struct _GtkTextIter {
   gpointer dummy10;
   gint dummy11;
   gint dummy12;
+  /* padding */
+  gint dummy13;
+  gpointer dummy14;
 };
 
 
index 61837c96f394c6dbed5bde71cef364770cf72cd1..f9a820ba272a58cfc3e80e2c8fa685dbf8fcd79c 100644 (file)
@@ -92,10 +92,10 @@ main (int argc, char** argv)
   /* Put stuff in the buffer */
 
   fill_buffer (buffer);
-#if 0
+
   /* Subject stuff-bloated buffer to further torment */
   run_tests (buffer);
-#endif
+
   /* Delete all stuff from the buffer */
   gtk_text_buffer_get_bounds (buffer, &start, &end);
   gtk_text_buffer_delete (buffer, &start, &end);